<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="vue_dev.js"></script>
</head>

<body>
    <div id="app">
        Total Price:{{ prices }}
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                package1: [{
                        name: 'iphone7',
                        price: 7199,
                        count: 2
                    },
                    {
                        name: 'iphoneX',
                        price: 8899,
                        count: 1
                    }
                ],
                package2: [{
                        name: 'apple',
                        price: 3,
                        count: 5
                    },
                    {
                        name: 'orange',
                        price: 2,
                        count: 6
                    }
                ]
            },
            computed: {
                prices: function () {
                    var prices = 0;
                    for (let i = 0; i < this.package1.length; i++) {
                        prices += this.package1[i].price * this.package1[i].count;
                    }
                    for (let i = 0; i < this.package2.length; i++) {
                        prices += this.package2[i].price * this.package2[i].count;
                    }
                    return prices;
                }
            }

        })
    </script>
</body>

</html>